<?php
require_once ("src/db/connectdatabase.php");

function getCompareDetailCard($id) {
	$con = new ConnectDB();
	
	$sql = "SELECT carddetailid, bankid, bankname, banklogo, cardlimit, cardtypename, cardtypelogo, cardlevelname, balancetransfer, monthstransfer, interestrate, annualfee, interestfreedays, latepaymentfee, minimumrepayment, phiruttien, areaofcards, linkgotosite FROM carddetail WHERE carddetailid='".$id."'";
	return $con -> getvalueString($sql);
}

if(isset($_GET['id'])) {
	$idload = $_GET['id'];
	$arrload = getCompareDetailCard($idload);
	if(count($arrload) > 0) {
?>
<style>
.table-detail-compare td {
	height: 40px;
}
</style>
<div class="text12" style="margin: auto; width: 970px; height: 11px; margin-top: 11px; color: #0a8bd9;">
	<u><a href="<?php echo($host) ?>" class="text12" style="color: #0080d6;">Trang chủ</a></u>&gt; Thẻ tín dụng
</div>
<div style="clear:both; height:15px;"></div>
<div class="intrl_txt" style="margin: auto;">
    <div style="float: left; width: 660px; margin-top: 20px; clear: right;">
        <div id="txt">
        	<table width="640px" border="0px" class="table-detail-compare" style="font-size: 12px;">
            	<tr>
            		<td align="left" width="200px"><span style="margin-left: 20px;">Ngân Hàng</span></td>
                    <td align="center" width="460px"><img height="50px" title="<?php echo($arrload[0][2]) ?>(<?php echo($arrload[0][1]) ?>)" alt="<?php echo($arrload[0][2]) ?>" src="<?php echo($arrload[0][3]) ?>" /><td>
                </tr>
                <tr>
            		<td style="background: #F1F1F1;" align="left" width="200px"><span style="margin-left: 20px;">Hạn mức thẻ</span></td>
                    <td style="background: #F1F1F1;" align="center"><?php echo(changnumbermoney($arrload[0][4])) ?><td>
                </tr>
                <tr>
            		<td align="left" width="200px"><span style="margin-left: 20px;">Loại thẻ</span></td>
                    <td align="center"><img height="50px" title="<?php echo($arrload[0][5]) ?>" alt="<?php echo($arrload[0][5]) ?>" src="<?php echo($arrload[0][6]) ?>" /><td>
                </tr>
                <tr>
            		<td  style="background: #F1F1F1;"align="left" width="200px"><span style="margin-left: 20px;">Loại Thẻ</span></td>
                    <td  style="background: #F1F1F1;"align="center"><?php echo($arrload[0][7]) ?><td>
                </tr>
                <tr>
            		<td align="left" width="200px"><span style="margin-left: 20px;">Chuyển Khoản Số Dư</span></td>
                    <td align="center"><?php echo(changnumbermoney($arrload[0][8])) ?>(<?php echo($arrload[0][9]) ?> Tháng)<td>
                </tr>
                <tr>
            		<td style="background: #F1F1F1;" align="left" width="200px"><span style="margin-left: 20px;">Lãi Xuất</span></td>
                    <td style="background: #F1F1F1;" align="center"><?php echo($arrload[0][10]) ?>%<td>
                </tr>
                <tr>
            		<td align="left" width="200px"><span style="margin-left: 20px;">Lệ Phí Hằng Năm</span></td>
                    <td align="center"><?php echo(changnumbermoney($arrload[0][11])) ?><td>
                </tr>
                <tr>
            		<td style="background: #F1F1F1;" align="left" width="200px"><span style="margin-left: 20px;">Số Ngày Miễn Phí</span></td>
                    <td style="background: #F1F1F1;" align="center"><?php echo($arrload[0][12]) ?> Ngày<td>
                </tr>
                <tr>
            		<td align="left" width="200px"><span style="margin-left: 20px;">Phí Chậm Thanh Toán</span></td>
                    <td align="center"><?php echo(changnumbermoney($arrload[0][13])) ?><td>
                </tr>
                <tr>
            		<td  style="background: #F1F1F1;"align="left" width="200px"><span style="margin-left: 20px;">Trả Nợ Tối Thiểu</span></td>
                    <td  style="background: #F1F1F1;"align="center"><?php echo(changnumbermoney($arrload[0][14])) ?><td>
                </tr>
                <tr>
            		<td align="left" width="200px"><span style="margin-left: 20px;">Phí Rút Tiền Mặt</span></td>
                    <td align="center"><?php echo($arrload[0][15]) ?><td>
                </tr>
                <tr>
            		<td style="background: #F1F1F1;" align="left" width="200px"><span style="margin-left: 20px;">Khu Vực Cấp Thẻ</span></td>
                    <td style="background: #F1F1F1;" align="center"><?php echo($arrload[0][16]) ?><td>
                </tr>
                 <tr>
            		<td align="left" width="200px"><span style="margin-left: 20px;">Liên Kết</span></td>
                    <td align="center"><a target="_blank" href="<?php echo($arrload[0][17]) ?>">Liên Kết</a><td>
                </tr>
            </table>
        </div>
    </div>
	
    <div style="float: right; clear: right; background-image: url(<?php echo($host) ?>images/gray_bg.gif); width: 275px; height: auto; margin-top: 10px;">
        <?php include("formsendapplyloan.php"); ?>
    </div>
</div>
<?php
	}
}
?>